<template>
  <!--视频预览    一行3列的内容-->
  <v-list-item>
    <v-list-item-content v-for="(video,i) in videoData" :key="i">
      <video
          controls
          width=30%
          :src="videoData.at(i)">
      </video>
    </v-list-item-content>

  </v-list-item>
</template>

<script>
import axios from "axios";

export default {
  name: "PreviewVideos",
  mounted() {
   // this.loadVideo();
  },
  methods: {
    //获取首页的视频
    loadVideo()
    {
      axios.get('')
          .then(res => {
            if (res.status == 200) {
              //仅获取前3个视频
              this.videoData = res.data.slice(0,3);
              // this.videoData;
            }
          }).catch(err=>{
        alert('视频加载失败！准备刷新！');
        window.local.reload();
      })
    }
  },
  data() {
    return {
      videoData: [
        require('@/videos/圣诞节.mp4'),
        require('@/videos/极光.mp4'),
        require('@/videos/美女与花朵.mp4'),
      ]
    }
  }
}
</script>

<style scoped>

</style>